package com.ruoyi.easyfame.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.easyfame.mapper.BankBusinessFunctionMapper;
import com.ruoyi.easyfame.domain.BankBusinessFunction;
import com.ruoyi.easyfame.service.IBankBusinessFunctionService;

/**
 * 银行业务功能Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-09
 */
@Service
public class BankBusinessFunctionServiceImpl implements IBankBusinessFunctionService 
{
    @Autowired
    private BankBusinessFunctionMapper bankBusinessFunctionMapper;

    /**
     * 查询银行业务功能
     * 
     * @param id 银行业务功能主键
     * @return 银行业务功能
     */
    @Override
    public BankBusinessFunction selectBankBusinessFunctionById(Long id)
    {
        return bankBusinessFunctionMapper.selectBankBusinessFunctionById(id);
    }

    /**
     * 查询银行业务功能列表
     * 
     * @param bankBusinessFunction 银行业务功能
     * @return 银行业务功能
     */
    @Override
    public List<BankBusinessFunction> selectBankBusinessFunctionList(BankBusinessFunction bankBusinessFunction)
    {
        bankBusinessFunction.setBankId(SecurityUtils.getDeptId());
        return bankBusinessFunctionMapper.selectBankBusinessFunctionList(bankBusinessFunction);
    }

    /**
     * 新增银行业务功能
     * 
     * @param bankBusinessFunction 银行业务功能
     * @return 结果
     */
    @Override
    public int insertBankBusinessFunction(BankBusinessFunction bankBusinessFunction)
    {
        bankBusinessFunction.setBankId(SecurityUtils.getDeptId());
        bankBusinessFunction.setCreateTime(DateUtils.getNowDate());
        return bankBusinessFunctionMapper.insertBankBusinessFunction(bankBusinessFunction);
    }

    /**
     * 修改银行业务功能
     * 
     * @param bankBusinessFunction 银行业务功能
     * @return 结果
     */
    @Override
    public int updateBankBusinessFunction(BankBusinessFunction bankBusinessFunction)
    {
        bankBusinessFunction.setUpdateTime(DateUtils.getNowDate());
        return bankBusinessFunctionMapper.updateBankBusinessFunction(bankBusinessFunction);
    }

    /**
     * 批量删除银行业务功能
     * 
     * @param ids 需要删除的银行业务功能主键
     * @return 结果
     */
    @Override
    public int deleteBankBusinessFunctionByIds(Long[] ids)
    {
        return bankBusinessFunctionMapper.deleteBankBusinessFunctionByIds(ids);
    }

    /**
     * 删除银行业务功能信息
     * 
     * @param id 银行业务功能主键
     * @return 结果
     */
    @Override
    public int deleteBankBusinessFunctionById(Long id)
    {
        return bankBusinessFunctionMapper.deleteBankBusinessFunctionById(id);
    }
}
